The present invention relates generally to a voice coding method, and more particularly, to improvements of an adaptive pulse code modulation (APCM) method and an adaptive differential pulse code modulation (ADPCM) method.
As a coding system of a voice signal, an adaptive pulse code modulation (APCM) method and an adaptive difference pulse code modulation (ADPCM) method, and so on have been known.
The ADPCM is a method of predicting the current input signal from the past input signal, quantizing a difference between its predicted value and the current input signal, and then coding the quantized difference. On the other hand, in the ADPCM, a quantization step size is changed depending on the variation in the level of the input signal.
FIG. 11 illustrates the schematic construction of a conventional ADPCM encoder 4 and a conventional ADPCM decoder 5. n used in the following description is an integer.
Description is now made of the ADPCM encoder 4.
A first adder 41 finds a difference (a prediction error signal dn) between a signal xn signal yn on the basis of the following equation (1):
dn=xnxe2x88x92ynxe2x80x83xe2x80x83(1)
A first adaptive quantizer 42 codes the prediction error signal dn found by the first adder 41 on the basis of a quantization step size Tn, to find a code Ln. That is, the first adaptive quantizer 42 finds the code Ln on the basis of the following equation (2). The found code Ln is sent to a memory 6.
Ln=[dn/Tn]xe2x80x83xe2x80x83(2)
In the equation (2), [ ] is Gauss"" notation, and represents the maximum integer which does not exceed a number in the square brackets. An initial value of the quantized value Tn is a positive number.
A first quantization step size updating device 43 finds a quantization step size Tn+1 corresponding the subsequent voice signal sampling value Xn+1 on the basis of the following equation (3). The relationship between the code Ln and a function M (Ln) is as shown in Table 1. Table 1 shows an example in a case where the code Ln is composed of four bits.
xe2x80x83Tn+1=Tnxc3x97M(Ln)xe2x80x83xe2x80x83(3)
A first adaptive reverse quantizer 44 reversely quantizes the prediction error signal dn using the code Ln, to find a reversely quantized value qn. That is, the first adaptive reverse quantizer 44 finds the reversely quantized value qn on the basis of the following equation (4):
qn=(Ln+0.5)xc3x97Tnxe2x80x83xe2x80x83(4)
A second adder 45 finds a reproducing signal wn the basis of the predicting signal yn ponding to the current voice signal sampling xn and the reversely quantized value qn. That is, the second adder 45 finds the reproducing signal wn on the basis of the following equation (5):
wn=yn+qnxe2x80x83xe2x80x83(5)
A first predicting device 46 delays the reproducing signal wn by one sampling time, to find a predicting signal yn+1 corresponding to the subsequent voice signal sampling value x+1.
Description is now made of the ADPCM decoder 5.
A second adaptive reverse quantizer 51 uses a code Lnxe2x80x2 obtained from the memory 6 and a quantization step size Tnxe2x80x2 obtained by a second quantization step size updating device 52, to find a reversely quantized value qnxe2x80x2 on the basis of the following equation (6).
qnxe2x80x2=(Lnxe2x80x2+0.5)xc3x97Tnxe2x80x2xe2x80x83xe2x80x83(6)
If Ln found in the ADPCM encoder 4 is correctly transmitted to the ADPCM decoder 5, that is, Ln=Lnxe2x80x2, the values of qnxe2x80x2, ynxe2x80x2, Tnxe2x80x2 and wnxe2x80x2 used on the side of the ADPCM decoder 5 are respectively equal to the values of qn, yn, Tn and wn used on the side of the ADPCM encoder 4.
The second quantization step size updating device 52 uses the code Lnxe2x80x2 obtained from the memory 6, to find a quantization step size Tn+1xe2x80x2 used with respect to the subsequent code Ln+1xe2x80x2 on the basis of the following equation (7) The relationship between Lnxe2x80x2 and a function M (Lnxe2x80x2) in the following equation (7) is the same as the relationship between Ln and the function M (Ln) in the foregoing Table 1.
Tn+1xe2x80x2=Tnxe2x80x2xc3x97M(Lnxe2x80x2)xe2x80x83xe2x80x83(7)
A third adder 53 finds a reproducing signal wnxe2x80x2 on the basis of a predicting signal ynxe2x80x2 obtained by a second predicting device 54 and the reversely quantized value qnxe2x80x2. That is, the third adder 53 finds the reproducing signal wnxe2x80x2 on the basis of the following equation (8). The found reproducing signal wnxe2x80x2 is outputted from the ADPCM decoder 5.
wnxe2x80x2=ynxe2x80x2+qnxe2x80x2xe2x80x83xe2x80x83(8)
The second predicting device 54 delays the reproducing signal wnxe2x80x2 by one sampling time, to find the subsequent predicting signal yn+1xe2x80x2, and sends the predicting signal yn+1xe2x80x2 to the third adder 53.
FIGS. 12 and 13 illustrate the relationship between the reversely quantized value qn and the prediction error signal dn in a case where the code Ln is composed of three bits.
T in FIG. 12 and U in FIG. 13 respectively represent quantization step sizes determined by the first quantization step size updating device 43 at different time points, where it is assumed that T less than U.
In a case where the range A to B of the prediction error signal dn is indicated by A and B, the range is indicated by xe2x80x9c[Axe2x80x9d when a boundary A is included in the range, while being indicated by xe2x80x9c(Axe2x80x9d when it is not included therein. Similarly, the range is indicated by xe2x80x9cB]xe2x80x9d when a boundary B is included in the range, while being indicated by xe2x80x9cB)xe2x80x9d when it is not included therein.
In FIG. 12, the reversely quantized value qn is 0.5T when the value of the prediction error signal dn is in the range of [0, T), 1.5T when it is in the range of [T, 2T), 2.5T when it is in the range of [2T, 3T) and 3.5T when it is in the range of [3T, ∞].
The reversely quantized value qn is xe2x88x920.5T when the value of the prediction error signal dn is in the range of [xe2x88x92T, 0), xe2x88x921.5T when it is in the range of [xe2x88x922T, xe2x88x92T) xe2x88x922.5 when it is in the range of [xe2x88x923T, xe2x88x922T), and xe2x88x923.5T when it is in the range of [xe2x88x92∞, xe2x88x923T)
In the relationship between the reversely quantized value qn and the prediction error signal dn in FIG. 13, T in FIG. 12 is replaced with U. As shown in FIGS. 12 and 13, the relationship between the reversely quantized value qn and the prediction error signal dn is so determined that the characteristics are symmetrical in a positive range and a negative range of the prediction error signal dn in the prior art. As a result, even when the prediction error signal dn is small, the reversely quantized value qn is not zero.
As can be seen from the equation (3) and Table 1, when the code Ln becomes large, the quantization step size Tn is made large. That is, the quantization step size is made small as shown in FIG. 12 when the prediction error signal dn is small, while being made large as shown in FIG. 13 when the prediction error signal dn is large.
In a voice signal, there exist a lot of silent sections where the prediction error signal dn is zero. In the above-mentioned prior art, however, even when the prediction error signal dn is zero, the reversely quantized value qn is 0.5T(or 0.5U) which is not zero, so that an quantizing error is increased.
In the above-mentioned prior art, even if the absolute value of the prediction error signal dn is rapidly changed from a large value to a small value, a large value corresponding to the previous prediction error signal dn whose absolute value is large is maintained as the quantization step size, so that the quantizing error is increased. That is, in a case where the quantization step size is a relatively large value U as shown in FIG. 13, even if the absolute value of the prediction error signal dn is rapidly decreased to a value close to zero, the reversely quantized value qn is 0.5U which is a large value, so that the quantizing error is increased.
Furthermore, even if the absolute value of the prediction error signal dn is rapidly changed from a small value to a large value, a small value corresponding to the previous prediction error signal dn whose absolute value is small is maintained as the quantization step size, so that the quantizing error is increased.
Such a problem similarly occurs even in APCM using an input signal as it is in place of the prediction error signal dn.
An object of the present invention is to provide a voice coding method capable of decreasing a quantizing error when a prediction error signal dn is zero or an input signal is rapidly changed.
A first voice coding method according to the present invention is a voice coding method for adaptively quantizing a difference dn between an input signal xn and a predicted value yn to code the difference, characterized in that adaptive quantization is performed such that a reversely quantized value qn of a code Ln corresponding to a section where the absolute value of the difference dn is small is approximately zero.
A second voice coding method according to the present invention is characterized by comprising the first step of adding, when a first prediction error signal dn which is a difference between an input signal xn and a predicted value yn corresponding to the input signal xn is not less than zero, one-half of a quantization step size Tn to the first prediction error signal dn to produce a second prediction error signal en, while subtracting, when the first prediction error signal dais less than zero, one-half of the quantization step size Tn from the first prediction error signal dn to produce a second prediction error signal en, the second step of finding a code Ln on the basis of the second prediction error signal en found in the first step and the quantization step size Tn, the third step of finding a reversely quantized value qn on the basis of the code Ln found in the second step, the fourth step of finding a quantization step size Tn+1 corresponding to the subsequent input signal xn+1 on the basis of the code Ln found in the second step, and the fifth step of finding a predicted value yn+1 corresponding to the subsequent input signal xn+1 on the basis of the reversely quantized value qn found in the third step and the predicted value yn.
In the second step, the code Ln is found on the basis of the following equation (9), for example:
Ln=[en/Tn]xe2x80x83xe2x80x83(9)
where [ ] is Gauss"" notation, and represents the maximum integer which does not exceed a number in the square brackets.
In the third step, the reversely quantized value qn is found on the basis of the following equation (10), for example:
qn=Lnxc3x97Tnxe2x80x83xe2x80x83(10)
In the fourth step, the quantization step size Tn+1 is found on the basis of the following equation (11), for example:
Tn+1=Tnxc3x97M(Ln)xe2x80x83xe2x80x83(11)
where M (Ln) is a value determined depending on Ln.
In the fifth step, the predicted value yn+1 is found on the basis of the following equation (12), for example:
yn+1=yn+qnxe2x80x83xe2x80x83(12)
A third voice coding method according to the present invention is a voice coding method for adaptively quantizing a difference dn between an input signal xn and a predicted value yn to code the difference, characterized in that adaptive quantization is performed such that a reversely quantized value qn of a code Ln corresponding to a section where the absolute value of the difference dn is small is approximately zero, and a quantization step size corresponding to a section where the absolute value of the difference dn is large is larger, as compared with that corresponding to the section where the absolute value of the difference dn is small.
A fourth voice coding method according to the present invention is characterized by comprising the first step of adding, when a first prediction error signal dn which is a difference between an input signal xn and a predicted value yn corresponding to the input signal xn is not less than zero, one-half of a quantization step size Tn to the first prediction error signal dn to produce a second prediction error signal en, while subtracting, when the first prediction error signal dn is less than zero, one-half of the quantization step size Tn from the first prediction error signal dn to produce a second prediction error signal en, the second step of finding, on the basis of the second prediction error signal en found in the first step and a table previously storing the relationship between the second prediction error signal en and a code Ln, the code Ln, the third step of finding, on the basis of the code Ln found in the second step and a table previously storing the relationship between the code Ln and a reversely quantized value qn, the reversely quantized value qn, the fourth step of finding, on the basis of the code Ln found in the second step and a table previously storing the relationship between the code Ln and a quantization step size Tn+1 corresponding to the subsequent input signal xn+1, the quantization step size Tn+1 corresponding to the subsequent input signal xn+1, and the fifth step of finding a predicted value yn+1 corresponding to the subsequent input signal xn+1 on the basis of the reversely quantized value qn found in the third step and the predicted value yn, wherein each of the tables is produced so as to satisfy the following conditions (a), (b) and (c):
(a) The quantization step size Tn is so changed as to be increased when the absolute value of the difference dn is so changed as to be increased,
(b) The reversely quantized value qn of the code Ln corresponding to a section where the absolute value of the difference dn is small is approximately zero, and
(c) A substantial quantization step size corresponding to a section where the absolute value of the difference dn is large is larger, as compared with that corresponding to the section where the a absolute value of the difference dn is small.
In the fifth step, the predicted value yn+1 is found on the basis of the following equation (13), for example:
yn+1=yn+qnxe2x80x83xe2x80x83(13)
A fifth voice coding method according to the present invention is a voice coding method for adaptively quantizing an input signal xn to code the input signal, characterized in that adaptive quantization is performed such that a reversely quantized value of a code Ln corresponding to a section where the absolute value of the input signal xn is small is approximately zero.
A sixth voice coding method according to the present invention is characterized by comprising the first step of adding one-half of a quantization step size Tn to an input signal xn to produce a corrected input signal gn when the input signal xn is not less than zero, while subtracting one-half of the quantization step size Tn from the input signal xn to produce a corrected input signal gn when the input signal xn is less than zero, the second step of finding a code Ln on the basis of the corrected input signal gn found in the first step and the quantization step size Tn, the third step of finding a quantization step size Tn+1 corresponding to the subsequent input signal xn+1 on the basis of the code Ln found in the second step, and the fourth step of finding a reproducing signal wnxe2x80x2 on the basis of the code Lnxe2x80x2(=Ln) found in the second step.
In the second step, the code Ln is found on the basis of the following equation (14), for example:
Ln=[gn/Tn]xe2x80x83xe2x80x83(14)
where [ ] is Gauss"" notation, and represents the maximum integer which does not exceed a number in the square brackets.
In the third step, the quantization step size Tn+1 is found on the basis of the following equation (15), for example:
Tn+1=Tnxc3x97M(Ln)xe2x80x83xe2x80x83(15)
where M (Ln) is a value determined depending on Ln.
In the fourth step, the reproducing signal wnxe2x80x2 is found on the basis of the following equation (16), for example:
wnxe2x80x2=Lnxe2x80x2(=Ln)xc3x97Tnxe2x80x2xe2x80x83xe2x80x83(16)
A seventh voice coding method according to the present invention is a voice coding method for adaptively quantizing an input signal xn to code the input signal, characterized in that adaptive quantization is performed such that a reversely quantized value qn of a code Ln corresponding to a section where the absolute value of the input signal xn is small is approximately zero, and a quantization step size corresponding to a section where the absolute value of the input signal xn is large is larger, as compared with that corresponding to the section where the absolute value of the input signal xn is small.
An eighth voice coding method according to the present invention is characterized by comprising the first step of adding one-half of a quantization step size Tn to an input signal xn to produce a corrected input signal gn when the input signal dn is not less than zero, while subtracting one-half of the quantization step size Tn from the input signal xn to produce a corrected input signal gn when the input signal xn is less than zero, the second step of finding, on the basis of the corrected input signal gn found in the first step and a table previously storing the relationship between the signal gn and a code Ln, the code Ln, the third step of finding, on the basis of the code Ln found in the second step and a table previously storing the relationship between the code Ln and a quantization step size Tn+1 corresponding to the subsequent input signal xn+1, the quantization step size Tn+1 corresponding to the subsequent input signal xn+1, and the fourth step of finding, on the basis of the code Lnxe2x80x2(=Ln) found in the second step and a table storing the relationship between the code Lnxe2x80x2(=Ln) and a reproducing signal wnxe2x80x2, the reproducing signal wnxe2x80x2, wherein each of the tables is produced so as to satisfy the following conditions (a), (b) and (c):
(a) The quantized value Tn is so changed as to be increased when the absolute value of the input signal xn is so changed as to be increased,
(b) The reversely quantized value qn of the code Ln corresponding to a section where the absolute value of the input signal xn is small is approximately zero, and
(c) A substantial quantization step size corresponding to a section where the absolute value of the input signal xn is large is made larger, as compared with that corresponding to the section where the absolute value of the input signal xn is small.